I have a buffer with rich text (extracted from Object Text attribute). I want to put some plain text in front of the string in the buffer, but haven't figured out how to do so.
I tried putting my plain text into a buffer and combining with the other buffer:
//note: hBfr has object text with rich text markup.
Buffer fLang=create
flang="TEST. "
fLang+=hBfr
hBfr=fLang
delete(fLang)
//now try to output hBfr (exporting to Word
//...all I get is an underscore. :(
Since this doesn't work (only see an underscore in my output, as noted) ... any ideas on how this might be corrected? strathglass - Thu Jun 18 14:37:13 EDT 2015 |
Re: Prepend plain string at front of RTF buffer? You declared Buffer fLang. then, you created a string called flang (notice the capital L vs the lowercase l) and set it equal to "TEST". Then you added hBfr to the currently empty fLang buffer. Then you set hBfr equal to fLang and finally delted fLang. Remember that DXL allows you to auto-declare variables which is very dangerous exactly because of what you have going on right there. Fix your third line of code to be correctly spelled and cased. This code should work fine then. You can turn off auto-declaration of variables to prevent this sort of garbage from happening, by the way. Open the file 'startup.dxl' located in 'C:\Program Files (x86)\IBM\Rational\DOORS\[versionNumber]\lib\dxl'. Add the following line of code: XFLAGS_ &=~AutoDeclare_ Then restart DOORS. you will find that you have a syntax error on line three of this code and it would not compile. |
Re: Prepend plain string at front of RTF buffer? yes Autodeclare and the lower case "l". hBfr = fLang // does not assign the contents, changes the pointer of hBfr to the same Buffer as fLang delete(fLang) // deletes the buffer pointed to by fLang; which is also pointed to by nBfr because of previous statement. note that variable "fLang" is now null, but hBfr still points to the de-allocated area formerly containing fLang strings. Anyway, the following seems to be working:
-Louie |
Re: Prepend plain string at front of RTF buffer? llandale - Sat Jun 27 17:37:29 EDT 2015 yes Autodeclare and the lower case "l". hBfr = fLang // does not assign the contents, changes the pointer of hBfr to the same Buffer as fLang delete(fLang) // deletes the buffer pointed to by fLang; which is also pointed to by nBfr because of previous statement. note that variable "fLang" is now null, but hBfr still points to the de-allocated area formerly containing fLang strings. Anyway, the following seems to be working:
-Louie Thanks Louie and W. Didn't notice the typo, doh! I will try again. -S |